﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RegistrarMenu.aspx.cs" Inherits="RegistrarMenu" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../css/estilos.css" rel="stylesheet" />
    <link href="../../css/colorbox/colorbox.css" rel="stylesheet" />

    <title></title>
    <script type="text/javascript" src="../../js/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="../../js/colorbox/jquery.colorbox.js"></script>
    <script type="text/javascript" src="../../js/GEN_js.js"></script>

    <script type="text/javascript">
        function Validar() {
            if ($('#txtNombre').val() == '') {
                MostrarAlertaTXT($('#txtNombre'), "El campo Nombre es obligatorio", true);
                return false;
            } else {
                $('#txtNombre').removeClass("txt-box-campos-oblig-cb").addClass("txt-box-campos-oblig-sb");
                $("#colorbox, #cboxOverlay").appendTo('form:first');
                AbrirModal('330', '210', true, false, '#yesno', false);
                $('#yesno').css("display", "block");
                return false;
            }
        }

        function Aceptar() {
            window.parent.location.reload();
        }
    </script>
</head>
<body>
    <form id="frmMenu" runat="server">
        <div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="titulo-modal">Registro de Menú</td>
                </tr>
            </table>
            <table border="0" cellpadding="10px" cellspacing="0">
                <tr>
                    <td class="txt-campos-int">Sistema</td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlSistema" Width="220px" class="field_element"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="txt-campos-int">Menu Origen</td>
                    <td>
                        <asp:Label runat="server" ID="lblMenuPadre"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="txt-campos-int">Nombre</td>
                    <td align="left">
                        <input name="txtNombre" type="text" runat="server" onpaste="return false;" class="txt-box-campos-oblig-sb" id="txtNombre" style="width: 200px;">
                    </td>
                </tr>
                <tr>
                    <td class="txt-campos-int">Descripción</td>
                    <td align="left">
                        <textarea runat="server" id="txtDescripcion" class="textarea-box" cols="38" rows="3"></textarea>
                    </td>
                </tr>

                <tr>
                    <td class="txt-campos-int">Formulario</td>
                    <td align="left">
                        <asp:DropDownList runat="server" ID="ddlFormulario" Width="220px" class="field_element"></asp:DropDownList></td>
                </tr>

                <tr>
                    <td class="txt-campos-int">N° Orden</td>
                    <td align="left">
                        <input name="txtOrden" type="text" runat="server" onpaste="return false;" onkeypress="PermiteNumeros(event)" class="txt-box-campos" id="txtOrden" style="width: 30px;" value="0">
                        </td>
                </tr>
                <tr>
                    <td class="txt-campos-int">Estado</td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlEstado" Width="120px" class="field_element"></asp:DropDownList></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:HiddenField ID="hdfMenu" runat="server" />
                        <asp:Button ID="btnGrabar" OnClientClick="return Validar()" runat="server" CssClass="skip" Text="Grabar" />
                        <asp:Button ID="btnCancelar" OnClientClick="window.parent.CerrarModal();" runat="server" CssClass="skip" Text="Cancelar" />
                </tr>
            </table>
        </div>


        <div id="fijo" runat="server">
            <div class="alertaRegistro mensajes" runat="server" style="display: none;" id="dvAlerta2">
            </div>
        </div>

        <div id="yesno" style="display: none">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="titulo-modal">Mensaje del Sistema</td>
                </tr>
            </table>
            <br />
            <table width="100%" align="center" border="0" cellspacing="2" cellpadding="1">
                <tr>
                    <td align="center" width="72">
                        <img alt="Interrogación" src="../../images/icon-interrogacion-modal.png" /></td>
                    <td class="" align="center" style="padding-left: 6px; padding-right: 6px;">¿Esta seguro que desea guardar los cambios?</td>
                </tr>
            </table>
            <table width="80%" border="0" align="center" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="center">
                        <asp:Button ID="btnSi" runat="server" CssClass="skip" Text="Si" OnClick="btnSi_Click" />
                        <input id="btnNo" type="button" class="skip" onclick="window.parent.CerrarModal();" value="No" />
                    </td>
                </tr>
            </table>
        </div>

        <div id="confirmacion" style="display: none">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="titulo-modal">Mensaje del Sistema</td>
                </tr>
            </table>
            <br />
            <table width="100%" align="center" border="0" cellspacing="2" cellpadding="1">
                <tr>
                    <td align="center" width="72">
                        <img alt="confirmacion" src="../../images/icon-valido.png" /></td>
                    <td class="" align="center" style="padding-left: 6px; padding-right: 6px;">Los datos se guardaron correctamente.</td>
                </tr>
            </table>
            <table width="80%" border="0" align="center" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="center">
                        <asp:Button ID="btnAceptar" runat="server" CssClass="skip" Text="Aceptar" OnClientClick="Aceptar();" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
